function TbActivityText(params){ 
	 
}

TbActivityText.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new TbActivityText.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new TbActivityText.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new TbActivityText.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.tbatId=function(tbatId){if(this.proxy)return this.getProxy().tbatId(tbatId);  this.put("tbatId", tbatId);return this;};
	/** and tbat_id is null */
	this.tbatIdNull=function(){if(this.proxy)return this.getProxy().tbatIdNull();if(this.get("tbatIdNot")==null)this.put("tbatIdNot", "");this.put("tbatId", null);return this;};
	/** not .... */
	this.tbatIdNot=function(){if(this.proxy)return this.getProxy().tbatIdNot();this.put("tbatIdNot", "not");return this;};
	this.tbatIdNotNull=function(){if(this.proxy)return this.getProxy().tbatIdNotNull();this.put("tbatIdNot", "not");this.put("tbatId", null);return this;};
	this.tbatIdNot=function(tbatId){if(this.proxy)return this.getProxy().tbatIdNot(tbatId);this.put("tbatIdNot", "not");this.put("tbatId", tbatId);return this;};
	/** and tbat_id <= ? */
	this.tbatIdMin=function(min){if(this.proxy)return this.getProxy().tbatIdMin(min);this.put("tbatIdMin", min);return this;};
	/** and tbat_id >= ? */
	this.tbatIdMax=function(max){if(this.proxy)return this.getProxy().tbatIdMax(max);this.put("tbatIdMax", max);return this;};
	this.tbatIdIn=function(ids){
		if(this.proxy)return this.getProxy().tbatIdIn(ids);  this.put("tbatIdIn", ids);return this;
	};	
	
	/** 品牌  [Merchant]      **/
	this.tbatBrand=function(tbatBrand){if(this.proxy)return this.getProxy().tbatBrand(tbatBrand);  this.put("tbatBrand", tbatBrand);return this;};
	/** and tbat_brand is null */
	this.tbatBrandNull=function(){if(this.proxy)return this.getProxy().tbatBrandNull();if(this.get("tbatBrandNot")==null)this.put("tbatBrandNot", "");this.put("tbatBrand", null);return this;};
	/** not .... */
	this.tbatBrandNot=function(){if(this.proxy)return this.getProxy().tbatBrandNot();this.put("tbatBrandNot", "not");return this;};
	this.tbatBrandNotNull=function(){if(this.proxy)return this.getProxy().tbatBrandNotNull();this.put("tbatBrandNot", "not");this.put("tbatBrand", null);return this;};
	this.tbatBrandNot=function(tbatBrand){if(this.proxy)return this.getProxy().tbatBrandNot(tbatBrand);this.put("tbatBrandNot", "not");this.put("tbatBrand", tbatBrand);return this;};
	this.tbatBrandIn=function(ids){
		if(this.proxy)return this.getProxy().tbatBrandIn(ids);  this.put("tbatBrandIn", ids);return this;
	};	
	
	/** 内容        **/
	this.tbatContent=function(tbatContent){if(this.proxy)return this.getProxy().tbatContent(tbatContent);  this.put("tbatContent", tbatContent);return this;};
	/** and tbat_content is null */
	this.tbatContentNull=function(){if(this.proxy)return this.getProxy().tbatContentNull();if(this.get("tbatContentNot")==null)this.put("tbatContentNot", "");this.put("tbatContent", null);return this;};
	/** not .... */
	this.tbatContentNot=function(){if(this.proxy)return this.getProxy().tbatContentNot();this.put("tbatContentNot", "not");return this;};
	this.tbatContentNotNull=function(){if(this.proxy)return this.getProxy().tbatContentNotNull();this.put("tbatContentNot", "not");this.put("tbatContent", null);return this;};
	this.tbatContentNot=function(tbatContent){if(this.proxy)return this.getProxy().tbatContentNot(tbatContent);this.put("tbatContentNot", "not");this.put("tbatContent", tbatContent);return this;};
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有活动软文 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/business/activitytext.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取活动软文分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/business/activitytext.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取活动软文 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/business/activitytext.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

TbActivityText.get = function(id){
	var protocol = ux.ajax("/admin/business/activitytext.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.tbActivityText;
	return null;
}

TbActivityText.where = new TbActivityText.Where(0,true);